package com.yxh.lib_base.ext

import android.view.animation.Animation

/**
 * 作者 : yuan_xh
 * 时间 : 2022/8/30 9:38
 * 说明 :
 */
fun Animation.onAnimationListener(onAnimationStart :(()->Unit)?=null, onAnimationRepeat :(()->Unit)?=null,onAnimationEnd: () -> Unit) {
    setAnimationListener(object : Animation.AnimationListener {
        override fun onAnimationStart(animation: Animation?) {
            onAnimationStart?.invoke()
        }

        override fun onAnimationEnd(animation: Animation?) {
            onAnimationEnd.invoke()
        }

        override fun onAnimationRepeat(animation: Animation?) {
            onAnimationRepeat?.invoke()
        }
    })
}

